﻿@using Microsoft.AspNetCore.Mvc.Rendering
@using Wboy.Application.Dto.AdminModule.Dto
@model LoginDto;
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>EasyCMS - 登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="~/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="~/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="~/css/animate.min.css" rel="stylesheet">
    <link href="~/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="~/js/plugins/layer/theme/default/layer.css" rel="stylesheet" />
    <link href="~/js/plugins/validator/validator.css" rel="stylesheet" />
    <style>
        .loginscreen {
            width: 600px !important;
        }
        .middle-box {
            width: 600px !important;
        }
        .logo-name {
            font-size: 80px !important;
            letter-spacing: 0px !important;
            padding: 80px 0;
            color: black;
        }
    </style>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if (window.top !== window.self) { window.top.location = window.location; }</script>
</head>
<body class="gray-bg">
    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>
                <h4 class="logo-name">EasyCMS</h4>
            </div>
            <h3>欢迎使用进入 EasyCMS</h3>
            
            <div class="m-t" role="form">
                <form class="form-horizontal">
                    <input type="hidden" id="ReturnUrl" name="ReturnUrl" />
                    <div class="form-group">
                        <input type="text" name="LoginName" class="form-control" placeholder="请输入用户名" isvalid="yes" checkexpession="NotNull">
                    </div>
                    <div class="form-group">
                        <input type="password" name="Password" class="form-control" placeholder="请输入密码" isvalid="yes" checkexpession="NotNull">
                    </div>
                    <div class="form-group">
                        <button type="button" onclick="login()" class="btn btn-primary block full-width m-b">登 录</button>
                    </div>
                    @*<p class="text-muted text-center">
                        <a href="login.html#"><small>忘记密码了？</small></a> | <a href="register.html">注册一个新账号</a>
                    </p>*@
                </form>
            </div>
        </div>
    </div>
    <script src="~/js/jquery.min.js?v=2.1.4"></script>
<script src="~/js/bootstrap.min.js?v=3.3.6"></script>
<script src="~/js/plugins/validator/validator.js"></script>
    <script src="~/js/plugins/layer/layer.js"></script>
    <script src="~/js/common.js"></script>
    <script type="text/javascript">
        function login() {
            if (!$("form").Validform()) {
                return false;
            }
            var loadingIndex = layer.msg("登录中...", {
                icon: 16,
                time: 0//0秒表示不关闭
            });
            var data = $("form").serialize();
            $.ajax({
                url: "Login",
                data: data,
                type: "post",
                dataType: "json",
                async: false,
                success: function (result) {
                    layer.close(loadingIndex);
                    //Loading(false);
                    if (result.type == "1") {
                        location.href = result.resultdata;
                    } else {
                        top.layer.alert(result.message, {
                            icon: -1,
                            title: "提示",
                            move: false
                        });   
                    }
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    layer.close(loadingIndex);
                    //Loading(false);
                    alert(errorThrown);
                }
            });
        }
    </script>
</body>
</html>


